/*
 * @Author: wuqingchun
 * @Date: 2024-10-30 08:49:11
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-10-31 20:52:52
 */
#include "net_server.h"


CNetServer::CNetServer()
{

}

CNetServer::~CNetServer()
{

}

int32_t CNetServer::Init(const char* pcHost, uint16_t usPort)
{
    INetTCPServer* pobjServer = NewTCPServer(&m_objSelect, this, pcHost, usPort);
    if (pobjServer == nullptr)
    {
        return -1;
    }

    m_pobjServer = pobjServer;

    return 0;
}

int32_t CNetServer::Start()
{
    if (m_pobjServer == nullptr)
    {
        return -1;
    }

    return m_pobjServer->Start();
}

void CNetServer::OnConnected(INetTCPConnection *pobjConn)
{
    printf("%s\n", __FUNCTION__);
}

void CNetServer::OnDisconnected(INetTCPConnection *pobjConn)
{
    printf("%s\n", __FUNCTION__);
}

void CNetServer::OnMessage(const void* pData, size_t ulDataLen)
{
    printf("%s\n", __FUNCTION__);
}